home *** CD-ROM | disk | FTP | other *** search
/ FM Towns: Free Software Collection 9 / FM Towns Free Software Collection 9.iso / taropyon / silib / inc / silib.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-11-16  |  2.3 KB  |  67 lines

  1. #ifndef    _SILIB_H
  2. #define    _SILIB_H
  3.  
  4. #ifndef    _SITYPES_H
  5. #    include    <sitypes.h>
  6. #endif
  7.  
  8. #ifndef    _VA_LIST_DEFINED
  9. #    define _VA_LIST_DEFINED
  10.     typedef char *va_list;
  11. #endif
  12.  
  13. /*----------------------------------------------------------------------*/
  14. extern void        SI_set24h(void);
  15. extern void        SI_reset24h(void);
  16. extern void        SI_setCtrlC(void);
  17.  
  18. /*----------------------------------------------------------------------*/
  19. extern void       *(*SiFuncMalloc)(size_t);
  20. extern void       *(*SiFuncCalloc)(size_t,size_t);
  21. extern void        (*SiFuncFree)(void *);
  22.  
  23. extern void       *_si_malloc( size_t siz );
  24. extern void       *_si_calloc( size_t blk, size_t siz );
  25. extern void        _si_free( void *ptr );
  26.  
  27. #define    SI_MALLOC(_siz)            ((SiFuncMalloc)(_siz))
  28. #define    SI_CALLOC(_siz,_blk)    ((SiFuncCalloc)((_siz),(_blk)))
  29. #define    SI_FREE(_ptr)            (SiFuncFree)(_ptr)
  30.  
  31. /*----------------------------------------------------------------------*/
  32. extern int        SI_argSet( int *argcPtr, char **argvPtr[], CONST char *s );
  33. extern void        SI_argFree( int argc, char **argv );
  34.  
  35. /*----------------------------------------------------------------------*/
  36. #ifndef    _ISKAN_DEFINED
  37. #define    _ISKAN_DEFINED
  38. extern int        iskan(CONST char *str);
  39. #endif
  40.  
  41. /*----------------------------------------------------------------------*/
  42. extern unsigned int    GetSegFnt12x12(void);
  43. extern void            FreeSegFnt12x12(void);
  44.  
  45. /*----------------------------------------------------------------------*/
  46. extern unsigned int    GetSegIcn24x24(void);
  47. extern void            FreeSegIcn24x24(void);
  48.  
  49. /*----------------------------------------------------------------------*/
  50. #define    _SI_CLOCK_MAX    (24*60*60*CLOCKS_PER_SEC)
  51. #define    SI_CLOCK(_clk)    (clock() + (((unsigned int)(_clk) >= _SI_CLOCK_MAX) ? (_SI_CLOCK_MAX) : 0u))
  52.  
  53. extern unsigned int    _siClkNow;
  54.  
  55. #define    SI_ISTIMEIN(_clk)    (_siClkNow = clock(),((_clk) < _SI_CLOCK_MAX) \
  56.     ? (_siClkNow < (_clk))                                                \
  57.     : ( _siClkNow + _SI_CLOCK_MAX > (_clk)                                \
  58.       ? (TRUE) : (_siClkNow + _SI_CLOCK_MAX < (_clk))) )
  59. #define    SI_ISTIMEOUT(_clk)    (!SI_ISTIMEIN(_clk))
  60.  
  61. /*----------------------------------------------------------------------*/
  62. extern int        SI_bsprintf( char **ptr, CONST char *form, va_list arg );
  63.  
  64. /*----------------------------------------------------------------------*/
  65.  
  66. #endif
  67.